use XML::RPC;
use Data::Dumper;

my $xmlrpc = XML::RPC->new('http://aapugr.wordpress.com/xmlrpc.php');
my $result = $xmlrpc->call("metaWeblog.getRecentPosts", 1,'aapugr', '448e83', 2 );

#print Dumper( $result);
print Dumper( $result->[1]{'postid'});
print Dumper( $result->[1]{'title'});
print Dumper( $result->[1]{'description'});

print "Enviando modificación.. ";
$result = $xmlrpc->call("metaWeblog.editPost", $result->[1]{'postid'},'aapugr', '448e83', {'title'=>$result->[1]{'title'},'description' => "Muajajajajaja, soy malo y cambio el contenido del post"}, 1 ) ;

my $xmlrpc = XML::RPC->new('http://aapugr.wordpress.com/xmlrpc.php');
my $result = $xmlrpc->call("metaWeblog.getRecentPosts",1,'aapugr', '448e83',2);

print "Después de modificar: ","\n";
print "ID post:",$result->[1]{'postid'},"\n";
print "Titulo:",$result->[1]{'title'},"\n";
print "Descripcion:",$result->[1]{'description'},"\n";

